package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaCategoria extends javax.swing.JFrame {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JPanel panCategoria;
	private JButton btnCancelar;
	private JButton btnBuscar;
	private JTextField txtDescripcion;
	private JTextField txtCodigo;
	private JButton btnRegistrar;
	private JLabel lblDescripcion;
	private JLabel lblCodigoCat;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	
	
	public void agregarListener(ActionListener accion){
		btnBuscar.addActionListener(accion);
		btnCancelar.addActionListener(accion);
		btnRegistrar.addActionListener(accion);
		
	}
	
	
	
	//MENSAJE
		public void mostrarMensaje(String mensaje) {
			JOptionPane.showMessageDialog(this, mensaje);
		}

	
	public VentanaCategoria() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("REGISTAR CATEGORIA");
			getContentPane().setBackground(new java.awt.Color(255,255,255));
			{
				panCategoria = new JPanel();
				getContentPane().add(panCategoria, BorderLayout.CENTER);
				panCategoria.setBackground(new java.awt.Color(255,255,255));
				panCategoria.setLayout(null);
				{
					lblCodigoCat = new JLabel();
					panCategoria.add(lblCodigoCat);
					lblCodigoCat.setText("Codigo:");
					lblCodigoCat.setBounds(74, 76, 42, 16);
				}
				{
					lblDescripcion = new JLabel();
					panCategoria.add(lblDescripcion);
					lblDescripcion.setText("Descripcion:");
					lblDescripcion.setBounds(74, 127, 71, 16);
				}
				{
					btnRegistrar = new JButton();
					panCategoria.add(btnRegistrar);
					btnRegistrar.setText("Registrar ");
					btnRegistrar.setBounds(55, 187, 90, 26);
				}
				{
					btnCancelar = new JButton();
					panCategoria.add(btnCancelar);
					btnCancelar.setText("Cancelar");
					btnCancelar.setBounds(244, 187, 85, 26);
				}
				{
					txtCodigo = new JTextField();
					panCategoria.add(txtCodigo);
					txtCodigo.setBounds(151, 74, 81, 21);
				}
				{
					txtDescripcion = new JTextField();
					panCategoria.add(txtDescripcion);
					txtDescripcion.setBounds(151, 125, 163, 20);
				}
				{
					btnBuscar = new JButton();
					panCategoria.add(btnBuscar);
					btnBuscar.setText("Buscar");
					btnBuscar.setBounds(238, 73, 76, 22);
				}
			}

			pack();
			setSize(400, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
